<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<p class="p1 p4">处处闻啼鸟</p>
		<p class="p2">处处闻啼鸟</p>
		<p class="p2 p4">处处闻啼鸟</p>
		<p class="p3 p4">处处闻啼鸟</p>
		
		<script>
		
		var a=document.getElementsByClassName("p4 p2");
		a[0].style.color="red";
		alert(a.length);
			
		</script>
		
	</body>
</html>
